@use '@carbon/react' as * with (
  $css--reset: false,
  $css--default-type: false,
  $font-path: 'https://fonts.camunda.io'
); // the 'with' part is temporary solution and has to be deleted when whole Optimize will be carbonized

@use '@carbon/react/scss/fonts/sans';
@use '@carbon/react/scss/themes';
@use '@carbon/react/scss/theme';
@use '@carbon/react/scss/type';

// temporary solution until we have a global reset (this is a workaround to use carbon font with reset disabled)
@include type.reset();
@include sans.medium();
@include sans.bold();

@import 'shared-styles/shared-styles.scss';
@import 'react-grid-layout/css/styles.css';
@import 'react-resizable/css/styles.css';

@import 'colors.scss';

:root {
  --z-notification: 9300;
  --z-login: 9200;
  --z-tooltip: 9100;
  --z-modal: 9000;
  --z-popup: 500; //popovers, dropdowns, ...
  --z-header: 400;
  --z-above: 1;
  --z-below: -1;
}

* {
  box-sizing: border-box;
}

:focus {
  outline: none;
}

html {
  @include theme.theme(themes.$white);
  color: var(--grey-darken-13);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;

  .dark {
    color: var(--silver-darken-87);
    @include theme.theme(themes.$g100);
  }
}

.Root-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; // for firefox see https://stackoverflow.com/a/28639686
  flex-basis: 0%; // for IE 11 see https://github.com/philipwalton/flexbugs/issues/134
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
}

main {
  flex-grow: 1;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
}

a {
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
}

a:active {
  color: inherit;
}

.focus-visible:not(
    .cds--search-input,
    .cds--text-input,
    .cds--text-area,
    .textInput,
    .cds--number__input-wrapper > input
  ) {
  outline: none;
  border-radius: 3px;
  box-shadow:
    var(--blue-darken-55) 0px 0px 0px 1px,
    var(--blue-lighten-75) 0px 0px 0px 4px;
  transition: box-shadow 0.05s ease-out 0s;
}

button,
select,
a,
input {
  &:focus {
    outline: none;
  }
}

button {
  margin: 0;
}

/* TYPOGRAPHY */
/* TEMP Heading styles -> use global CSS reset?
Use classes when more design work has been done */

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

input,
button,
select,
textarea,
option {
  font-family: inherit;
}

h1 {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 0.5em;
}

section h1 {
  font-size: 1.5em;
}

.small {
  font-size: 0.875em;
}

.textBold {
  font-weight: bold;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* UTILITIES */

.visually-hidden {
  @include visually-hidden;
}

a[disabled] {
  // support to disable links: https://github.com/ReactTraining/react-router/issues/1082
  pointer-events: none;
}

// TODO: remove this once OPT-7355 is fixed
// hide overlay displayed by dev server
iframe#webpack-dev-server-client-overlay {
  display: none;
}

// By default the notification component has some max width set, but we want it to take the full
.cds--actionable-notification,
.cds--inline-notification {
  max-inline-size: 100%;
}
